package com.lastproject.ejb.dao;

import javax.ejb.Remote;

import com.lastproject.dto.BookDTO;
import com.lastproject.dto.ReviewContentDTO;

@Remote
public interface ReviewContentDAORemote {

	/**
	 * Creates a ReviewContent object (where the content of a review is stored)
	 * and persists it to the database.
	 * 
	 * @param reviewContentDTO
	 *            a {@link ReviewContentDTO} object.
	 */
	void createContent(ReviewContentDTO reviewContentDTO);

	/**
	 * Given a book ID, it tries to find the given Book entity and converts it
	 * to a {@link BookDTO} before returning it.
	 * 
	 * @param bookId
	 *            the given book ID
	 * @return a {@link BookDTO} object.
	 */
	BookDTO getById(int bookId);

	/**
	 * Returns the review content from the database given a book.
	 * 
	 * @param bookDTO
	 *            the book to the the review content for.
	 * @return the review content
	 */
	byte[] getContent(BookDTO bookDTO);

	/**
	 * Checks if there exists a critic's review for a given book.
	 * 
	 * @param bookId
	 *            the id of the book.
	 * @return true, if critic's review exists, false, otherwise.
	 */
	int hasContent(int bookId);
}
